package com.sun.service.impl;

import com.sun.entity.Book;
import com.sun.entity.BookDTO;
import com.sun.mapper.BookMapper;
import com.sun.service.BookService;
import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author SunRui
 * @description TODO
 * @date 2024/9/25 8:55
 */
@Service
public class BookServiceImpl implements BookService {

    @Autowired
    BookMapper bookMapper;

    @Override
    public int addBook(Book book) {

        return 1;
//        return bookMapper.addBook(book);
    }

    @Override
    public List<BookDTO> selectBookDTO(String BookName, String Author) {
        return bookMapper.selectBookDTO(BookName, Author);
    }

    @Override
    public int updateBook(Book book) {
        System.out.println("修改书籍信息");
        return bookMapper.updateBook(book);
    }

    @Override
    public List<BookDTO> selectAllBook() {
        System.out.println("查看全部书籍信息");
        return bookMapper.selectAllBook();
    }
}
